<template>
  <Editor
    :value="value"
    :plugins="plugins"
    :mode="mode"
    @change="handleChange"
  />
</template>

<script setup lang="ts">
import gfm from "@bytemd/plugin-gfm";
import highlight from "@bytemd/plugin-highlight";
import "highlight.js/styles/default.css";
import { Editor } from "@bytemd/vue-next";

interface Props {
  value: string;
  mode?: string;
  handleChange: (v: string) => void;
}

// eslint-disable-next-line no-undef
withDefaults(defineProps<Props>(), {
  value: () => "",
  mode: () => "split",
  handleChange: (v: string) => {
    console.log(v);
  },
});

const plugins = [
  gfm(),
  highlight(),
  // Add more plugins here
];
</script>
<style>
#app {
}

.bytemd-toolbar-icon.bytemd-tippy.bytemd-tippy-right:last-child {
  display: none;
}

.bytemd.bytemd-split.bytemd-fullscreen {
  z-index: 100;
}
</style>
